import { request } from '@/service/request';
import type { MenuTreeOption, MenuVO, RoleMenuTreeselect, System } from '@/service/types/system';

export function fetchGetMenuList() {
  return request<System.MenuVo>({
    url: '/system/menu/menus',
    method: 'get'
  });
}

export function fetchGetMenuTree() {
  return request<MenuTreeOption>({
    url: '/system/menu/treeselect',
    method: 'get'
  });
}

export function getRoleMenuTreeselect(id: number) {
  return request<RoleMenuTreeselect>({
    url: `/system/menu/roleMenuTreeselect/${id}`,
    method: 'get'
  });
}

export function getPackageMenuTreeselect(id: number) {
  return request<RoleMenuTreeselect>({
    url: `/system/menu/tenantPackageMenuTreeselect/${id}`,
    method: 'get'
  });
}

export function menuList() {
  return request<MenuVO[]>({
    url: '/system/menu/list',
    method: 'get'
  });
}
